home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / devioustools21.dms / devioustools21.adf / utils / 009.lzx / netfs.h < prev    next >
C/C++ Source or Header  |  1984-01-01  |  3KB  |  112 lines

  1. /*
  2.  * $Id: netfs.h,v 1.3 1995/11/14 00:43:34 Rhialto Exp $
  3.  * $Log: netfs.h,v $
  4.  * Revision 1.3  1995/11/14  00:43:34  Rhialto
  5.  * More casts for yet stricter DICE type checking...
  6.  *
  7.  * Revision 1.2  1994/05/15  20:08:08  Rhialto
  8.  * Add #define DOSBase_DECLARED.
  9.  * Increase PENDREAD for up to 8 clients.
  10.  *
  11.  * Revision 1.1  1993/12/02  20:45:46  Rhialto
  12.  * Initial revision
  13.  *
  14.  *
  15.  * Network file system data structures
  16.  */
  17.  
  18. #include <stddef.h>
  19.  
  20. #define SysBase_DECLARED    /* for some older versions of DICE */
  21.  
  22. #ifndef CLIB_EXEC_PROTOS_H
  23. #include <clib/exec_protos.h>
  24. #endif
  25. #ifndef CLIB_ALIB_PROTOS_H
  26. #include <clib/alib_protos.h>
  27. #endif
  28.  
  29. #ifndef DOS_H
  30. #include "dos.h"
  31. #endif
  32.  
  33. typedef struct {
  34.     ULONG        nfl_FileLock;   /* Remote identifier */
  35.     ULONG        nfl_Validation;
  36. } NetFileLock;
  37.  
  38. typedef struct {
  39.     ULONG        nfh_FileHandle; /* Remote identifier */
  40.     ULONG        nfh_Validation;
  41. } NetFileHandle;
  42.  
  43. typedef enum {
  44.     pt_Retry = -1,
  45.     pt_Request, pt_Reply, pt_AsyncReply,
  46.     pt_Reset, pt_ResetReply
  47. } Type;
  48.  
  49. typedef struct Packet {
  50.     BYTE        p_Type;
  51.     BYTE        p_Origin;
  52.     BYTE        p_Seq;        /* Sequence number for reliable transnission */
  53.     BYTE        p_Ack;        /* Acknowledgement */
  54. #define COMMONSIZE  4
  55.     union {
  56.     /* Format for pt_Request */
  57.     struct pu1 {
  58.         ULONG        p1_Action;
  59.         ULONG        p1_Arg[6];
  60.     } p_Request;
  61.     /* Format for pt_(Async)Reply */
  62.     struct pu2 {
  63.         ULONG        p2_Res1;
  64.         ULONG        p2_Res2;
  65.         ULONG        p2_Data[0];
  66.     } p_Reply;
  67.     /* Format for pt_Reset(Reply) */
  68.     struct {
  69.         ULONG        p3_Validation;
  70.     } p_Reset;
  71.     char        p_Pad[3*4+256+256];
  72.     } p_Misc;
  73. } Packet;
  74.  
  75. #define p_Action    p_Misc.p_Request.p1_Action
  76. #define p_Arg        p_Misc.p_Request.p1_Arg
  77.  
  78. #define p_Res1        p_Misc.p_Reply.p2_Res1
  79. #define p_Res2        p_Misc.p_Reply.p2_Res2
  80. #define p_Data        p_Misc.p_Reply.p2_Data
  81.  
  82. #define p_Validation p_Misc.p_Reset.p3_Validation
  83.  
  84. #define REQSIZE(nargs)  (offsetof(Packet, p_Arg[0])+4*(nargs))
  85.  
  86. /* Standard reply size */
  87. /*#define STDREPLY    offsetof(Packet, p_Data[0])*/
  88. #define STDREPLY    (COMMONSIZE+sizeof(struct pu2))
  89.  
  90. #define MAXPKT        (COMMONSIZE+sizeof(struct pu1))
  91. #define MAXDATA     4096
  92. #define PKTSIZE     (MAXPKT + MAXDATA)
  93.  
  94. #define min(a,b)        ((a) < (b)? (a) : (b))
  95.  
  96. #define SRV_ADDR    1
  97. #define CLI_ADDR    2
  98. #define NETFS_PORT    0x25C        /* randomly chosen */
  99.  
  100. #define PENDREADS    16        /* Should be sufficient for PENDREADS/2
  101.                      * clients */
  102.  
  103. #ifndef Prototype
  104. #define Prototype   extern
  105. #endif
  106. #ifndef Local
  107. #define Local        static
  108. #endif
  109.  
  110. #include "proto.h"
  111.  
  112.